package sun.scheduler.core.resource;

import sun.scheduler.core.job.DummyJob;

/**
 * Represents a Resource within the project.
 */
public class Resource
{
    /**
     * Represents a DUMMY_RESOURCE used by {@link DummyJob}
     */
    public final static Resource DUMMY_RESOURCE = new Resource(0, 0, 1, new ResourceInfo(-1, "Dummy Model", "Dummy Resource"));
    /**
     * The max amount of spendable units of this {@link Resource}
     */
    public final int maxCapacity;
    /**
     * The cost per piece and per time unit. (Stundensatz)
     */
    public final double costPPT;
    
    /**
     * The aspectratio (Streckungsfaktor)
     */
    public final double aspectRatio;
    
    /**
     * The description of this resource.
     */
    public final ResourceInfo info;

    /**
     * Instantiates a new {@link Resource} from the given parameters.
     * @param maxCapacity
     * @param costPPT
     * @param aspectRatio
     * @param info 
     */
    public Resource(int maxCapacity, double costPPT, double aspectRatio, ResourceInfo info)
    {
        this.maxCapacity = maxCapacity;
        this.costPPT = costPPT;
        this.aspectRatio = aspectRatio;
        this.info = info;
    }

    @Override
    public boolean equals(Object obj)
    {
        return this == obj;
    }

    @Override
    public int hashCode()
    {
        return info.id;
    }
}
